from time import sleep
from Base import Base
from selenium.webdriver.common.by import By


class Page(Base):
    # 定位器
    # 输入框的定位
    search_loc = (By.ID, 'kw')
    searchdtn_loc = (By.ID, 'su')
    # 页面元素的封装
    # 对输入框的定位进行输入操作
    def search(self):
        # self.find_element(self.search_loc).send_keys('web')
        self.send_keys(self.search_loc, 'WEB')
    def search_dtn(self):
        self.click(self.searchdtn_loc)
    def baidu(self):
        self.open_url('https://www.baidu.com/')
        sleep(2)
        self.search()
        sleep(2)
        self.search_dtn()
